* in the wiki's own database. This is the most commonly used repository class.
*
* @ingroup FileRepo
+ * @method LocalFile|null newFile( $title, $time = false )
*/
class LocalRepo extends FileRepo {
/** @var callable */
public function execute() {
$repo = $this->file->repo;
$status = $repo->newGood();
- /** @var LocalFile $destFile */
$destFile = MediaWikiServices::getInstance()->getRepoGroup()->getLocalRepo()
->newFile( $this->target );
- '@phan-var LocalFile $destFile';
$this->file->lock();
$destFile->lock(); // quickly fail if destination is not available
$user
);
} else {
- '@phan-var LocalFile $file';
$flags = 0;
$status = $file->upload(
$source,
}
public function doPostCommitUpdates( array $visibilityChangeMap ) {
- /** @var LocalFile $file */
$file = MediaWikiServices::getInstance()->getRepoGroup()->getLocalRepo()
->newFile( $this->title );
- '@phan-var LocalFile $file';
$file->purgeCache();
$file->purgeDescription();
continue;
}
- /** @var LocalFile $file */
$file = $repo->newFile( $row->fa_name );
- '@phan-var LocalFile $file';
try {
$file->lock();
} catch ( LocalFileLockError $e ) {
if ( $this->hasOption( 'dry' ) ) {
$this->output( "done.\n" );
- // @phan-suppress-next-line PhanUndeclaredMethod
} elseif ( $image->recordUpload2(
$archive->value,
$summary,